<!DOCTYPE html>
    <?php 
    if (!empty($header)) {
        echo $header;
    }
    ?>
    <!--
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                        <link rel="stylesheet" type="text/css" href="/public/style/style1.css" />
                        <link rel="stylesheet" type="text/css" href="/public/style/style.css" />
                        <link rel="stylesheet" type="text/css" href="/public/style/layout.css" />
                        <link rel="stylesheet" href="/public/style/jquery-ui.css" />
                        <script src="/public/js/jquery/jquery-1.8.3.min.js"></script>
                        <script src="/public/js/jquery/jquery-ui.js"></script>
                        <script src="/public/js/comment.js"></script>
        </head>
        <body>
    -->
    <div class="maincontent"> 
        <div id="wrapper_detail">
            <div id="top_detail">
                <?php
                if (!empty($product_data)) { 
                    if (!$product_data["link"]) {                   
                        echo "<img id='imgProduct200' src='". NO_IMAGE. "'". "alt='' />";
                    }
                    else {
                        echo "<img id='imgProduct200' src='". $product_data["link"]. "'". "alt='' />";
                    }
                    echo "<p class='title_product_detail'>". $product_data["name"]. "</p>";
                    echo "<p>Người donate: <a href='" .$product_data["link_profile"].  "' id='linkDonate' target='_blank'>". $product_data["display_name"]. "</a></p>";
                    echo "<p>Thời gian: <span class='product_detail_info'>".$product_data["timeStart"].  "-". $product_data["timeEnd"].  "</span></p>";
                    echo "<p>Giá khởi điểm : <span class='product_detail_info'>".number_format($product_data["priceStart"]). " VND</span></p>";
                    echo "<p>Giá cao nhất : <span class='hightlight_money'>". number_format($product_data["highest_price"]). " VND </span></p>";
                    echo "<div class='clear_float'>";
                    echo "</div>";
                }
                else {
                    echo "Chưa có dữ liệu về sản phẩm";
                }
                ?>

            </div>       

            <div id="desc_detail_product">
                <p><?php 
                    if (!empty($product_data )) {
                        echo $product_data['description'] ;
                    }
                    else {
                        echo "Không có thông tin mô tả nào";
                    }
                    ?> </p>
            </div>
            <div id="bottom_detail">
                <div id="history">
                    <div id="title_history">
                        Lịch sử đấu giá
                    </div>
                    <div id="detail_history">
                        <p><a href=<?php 
                              if (!empty($transaction_product)) {
                                echo $transaction_product[0]["link"];
                              }
                              ?>> <?php 
                              if (!empty($transaction_product)) {
                                echo $transaction_product[0]["display_name"];
                              } 
                              ?></a><span class="highest_price_history">
                                  <?php 
                                  if (!empty($transaction_product)) {
                                echo $transaction_product[0]["price"];
                              } 
                                  
                                  ?>
                              </span></p>
                        <?php
                        if (!empty($transaction_product)) {                           
                        
                        }
                        ?>
                    </div>
                </div>
                <div id="comment_price">
                    <div id="price_notice">

                    </div>
                    <div id="price_apption">
                        Số tiền đấu giá : 
                        <form id="auction_form" name="auction_form">
                            <input type="text" id="txtPrice" name="txtPrice" size="15" />
                            <input type="hidden" id="idProduct" name="idProduct" value='<?php echo $product_data["idProduct"] ?>' />
                            <input type="hidden" id="idPeople" name="idPeople" value='<?php echo $product_data["idPeople"] ?>' />
                            <input type="button" id="btnSubmit" name="btnSubmit" value="Đặt giá" onclick="postPriceAunction();" />
                        </form>
                    </div>
                    <div id="comment_notice">

                    </div>
                    <div id="comment">
                        <form id="comment_form" name="comment_form">
                            <textarea id="comment_content" name="comment_content" placeholder="Bình luận gì..."></textarea>
                            <input type="hidden" id="idProduct" name="idProduct" value='<?php echo $product_data["idProduct"] ?>' />
                            <input type="hidden" id="idPeople" name="idPeople" value='<?php echo $product_data["idPeople"] ?>' />
                            <input type="button" id="commentSubmit" name="btnSubmit" value="Bình luận" onclick="postComment();" />
                        </form>
                        <div id="show_comment">

                        </div>
                    </div>
                </div>
                <div class="clear_float"></div>
            </div>

            <div id="products_autioning">
                <div id="title_pa">
                    Sản phẩm đang đấu giá
                </div>
                <div id="show_products">
                    <div class="sub_products">
                        
                        <?php
                        
                        if (!empty($product_auction_available)) {
                            foreach ($product_auction_available as $data) {
                                if (!$data['link_image']) {
                                     echo "<img src='". NO_IMAGE. "'". "class='img_subProduct'/>";
                                } 
                                 else {
                                    echo "<img src='". $data['link_image']. "'". "class='img_subProduct'/>";
                                }
                                echo "<p class='title_subProduct'>". "<a href='". $data['href']. "'". "class='link_subproduct'>". $data["name"]. "</a></p>";
                                echo "<p class='price_subProduct'>". $data["highest_price"]. " VND </p>";
                            }
                        }
                        else {
                            echo "Không có sản phẩm nào hiện tại được đấu giá";
                        }
                        
                        ?>
                        
                    </div>
                    <div class="clear_float"></div>
                </div>
            </div>
        </div>
    </div> 
</body>
</html>
